package org.jeecg.modules.charge.service.impl;

import org.jeecg.entity.charge.ChargeBills;
import org.jeecg.entity.charge.ChargeFeeitem;
import org.jeecg.entity.charge.ChargeInvoiceRequest;
import org.jeecg.modules.charge.entity.*;
import org.jeecg.modules.charge.entity.BwInvoiceEntity.InvoiceBwConfig;
import org.jeecg.modules.charge.mapper.ChargeBillsOrderMapper;
import org.jeecg.modules.charge.mapper.ComConfigMapper;
import org.jeecg.modules.charge.service.BillsOrderService;
import org.jeecg.modules.charge.service.ComConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: 缴费类型
 * @Author: jeecg-boot
 * @Date:   2019-08-15
 * @Version: V1.0
 */
@Service
public class ChargeEleinvoiceServiceImpl implements BillsOrderService,ComConfigService {
    @Autowired
    private ChargeBillsOrderMapper billsOrderMapper;
    @Autowired
    private ComConfigMapper comConfigMapper;


    @Override
    public ChargeBillsOrder getOrder(String sn) {
        return billsOrderMapper.getOrder(sn);
    }

    @Override
    public Integer insertInvoiceReq(ChargeInvoiceRequest deail) {
        return billsOrderMapper.insertInvoiceReq(deail);
    }

    @Override
    public String getRoomIdByCid(String cid) {
        return billsOrderMapper.getRoomIdByCid(cid);
    }

    @Override
    public Integer updateBillsInvoice(ChargeBills bills) {
        return billsOrderMapper.updateBillsInvoice(bills);
    }

    @Override
    public Integer getRateByRoomFeeCode(String roomid, String feecode) {
        return billsOrderMapper.getRateByRoomFeeCode(roomid, feecode);
    }

    @Override
    public ChargeFeeitem getFeeByCode(String fcode) {
        return billsOrderMapper.getFeeByCode(fcode);
    }

    @Override
    public String getSubNameByCode(String subcode) {
        return billsOrderMapper.getSubNameByCode(subcode);
    }

    @Override
    public void deleteInvoiceReq(String fpqqlsh) {
        billsOrderMapper.deleteInvoiceReq(fpqqlsh);
    }

    @Override
    public InvoiceBwConfig get(String comid) {
        return comConfigMapper.get(comid);
    }

    public void updateInvoiceReq(String statusInv,String urlReq, String remarks, String fpqqlsh){
        billsOrderMapper.updateInvoiceReq(statusInv, urlReq,  remarks, fpqqlsh);
    }


}
